import Book.BookList;
import User.Animal;
import User.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/4/15
 * Time: 10:25
 * Description: No Description
 */
public class Main {

    public static Animal login() {
        System.out.println("请输入姓名：");
        Scanner scan = new Scanner(System.in);
        String name = scan.nextLine();
        System.out.println("请选择登录用户账号 1.用户    2.管理员");
        int input = scan.nextInt();
        if(input == 1) {

            return new User(name);
        }
        else {
            return new Admin(name);
        }
    }

    public static void main(String[] args) {
        Animal animal = login();
        BookList bookList = new BookList();
        while(true) {
            int index = animal.menu();
            animal.fun(index,bookList);
        }
    }
}